//
//  DDNetworkManager.m
//  
//
//  Created by Qin on 16/6/7.
//  Copyright © 2016年 秦. All rights reserved.
//

#import "DDNetworkManager.h"
#import "AFNetworking.h"
#import "SVProgressHUD.h"
#import "DDCache.h"

@interface DDNetworkManager ()


@end

@implementation DDNetworkManager

DDNetworkObjSingleM;

+(void)loginPOST {
    AFHTTPSessionManager *manager = [self AFNetManager];
    AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init];
    [securityPolicy setAllowInvalidCertificates:NO];
    manager.securityPolicy = securityPolicy;
}

+ (void)GET:(NSString *)urlString parameters:(NSDictionary *)parameters success:(RequestSuccessBlock)resposeValue failure:(RequestFailureBlock )failure{

    [self starInfocatorVisible];
    
    [[self AFNetManager] GET:urlString
                         parameters:parameters
                         progress:^(NSProgress * _Nonnull downloadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        if (resposeValue) {
            resposeValue(responseObject);
        }
        [self stopIndicatorVisible];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        if (failure) {
             failure(error.localizedDescription);
        }
        [self showError:error.localizedDescription];
    }];
}

+ (void)GETCache:(NSString *)urlString parameters:(NSDictionary *)parameters success:(void (^)(id))resposeValue failure:(RequestFailureBlock )failure{
    [self starInfocatorVisible];
    [[self AFNetManager] GET:urlString
                         parameters:parameters
                         progress:^(NSProgress * _Nonnull downloadProgress) {
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        if (resposeValue) {
            resposeValue(responseObject);
        }
        [DDCache qsh_saveDataCache:responseObject forKey:urlString];
        [self stopIndicatorVisible];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        resposeValue([DDCache qsh_ReadCache:urlString]);
        if (failure) {
            failure(error.localizedDescription);
        }
        [self showError:error.localizedDescription];
    }];
}

+ (void)POST:(NSString *)urlString parameters:(NSDictionary *)parameters success:(RequestSuccessBlock)resposeValue failure:(RequestFailureBlock )failure{
    [self starInfocatorVisible];
    [[self AFNetManager] POST:urlString parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) {
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        if (resposeValue) {
            resposeValue(responseObject);
        }
        [self stopIndicatorVisible];
        
        /////////////////////////
        //   HSF:缓存，保存数据   //
        /////////////////////////
        [XHNetworkCache save_asyncJsonResponseToCacheFile:responseObject andURL:urlString params:parameters completed:^(BOOL result) {
            
            if(result)
            {
                NSLog(@"(异步)写入/更新缓存数据 成功");
            }
            else
            {
                NSLog(@"(异步)写入/更新缓存数据 失败");
            }
        }];
        
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        [self showError:error.localizedDescription];
        if (failure) {
            failure(error.localizedDescription);
        }
    }];
}

+ (void)POSTCache:(NSString *)urlString parameters:(NSDictionary *)parameters success:(void (^)(id))resposeValue failure:(RequestFailureBlock )failure {
    [self starInfocatorVisible];
    [[self AFNetManager] POST:urlString parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        if (resposeValue) {
            resposeValue(responseObject);
        }
        [DDCache qsh_saveDataCache:responseObject forKey:urlString];
        [self stopIndicatorVisible];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        resposeValue([DDCache qsh_ReadCache:urlString]);
        if (failure) {
            failure(error.localizedDescription);
        }
        [self showError:error.localizedDescription];
    }];
}

+ (void)POST:(NSString *)URLString
        parameters:(id)parameters
constructingBodyWithFormDataArray:(NSArray<FormData *> *)formDataArray
     success:(void (^)(id responseObject))success
     failure:(void (^)(NSError *error))failure
{
    [[self AFNetManager] POST:URLString
                         parameters:parameters
                         constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
        
        for (FormData * data in formDataArray) {
            [formData appendPartWithFileData:data.data
                      name:data.name
                      fileName:data.fileName
                      mimeType:data.mimeType];
            
        }
    } progress:^(NSProgress * _Nonnull uploadProgress) {
        NSLog(@"%lf",1.0 * uploadProgress.completedUnitCount / uploadProgress.totalUnitCount);
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        success(responseObject);
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        //   [MBProgressHUD showMessage:error.localizedDescription];
        
        failure(error);
    }];
}

+ (void)POSTs:(NSString *)URLString
  parameters:(id)parameters
constructingBodyWithFormDataArray:(NSArray *)formDataArray
     success:(void (^)(id responseObject))success
     failure:(void (^)(NSError *error))failure
{
    [[self AFNetManager] POST:URLString parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
        for (int i = 0; i < formDataArray.count; i++) {
            UIImage *image = formDataArray[i];
            NSData *imageData = UIImageJPEGRepresentation(image, 0.5);
            
            FormData *data = [[FormData alloc] init];
            data.name = [NSString stringWithFormat:@"avatar-%ld", (long)i];
            data.data = imageData;
            data.mimeType = @"image/jpg";
            data.fileName = @"headicon.jpg";
            
            [formData appendPartWithFileData:data.data
                                        name:data.name
                                    fileName:data.fileName
                                    mimeType:data.mimeType];
//            // 在网络开发中，上传文件时，是文件不允许被覆盖，文件重名
//            // 要解决此问题，
//            // 可以在上传时使用当前的系统事件作为文件名
//            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//            // 设置时间格式
//            [formatter setDateFormat:@"yyyyMMddHHmmss"];
//            NSString *dateString = [formatter stringFromDate:[NSDate date]];
//            NSString *fileName = [NSString  stringWithFormat:@"%@%d.jpg", dateString,i];
//            /*
//             *该方法的参数
//             1. appendPartWithFileData：要上传的照片[二进制流]
//             2. name：对应网站上[upload.php中]处理文件的字段（比如upload）
//             3. fileName：要保存在服务器上的文件名
//             4. mimeType：上传的文件的类型
//             */
//            [formData appendPartWithFileData:imageData name:@"Upload" fileName:fileName mimeType:@"image/jpeg"]; //
        }
    } progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        success(responseObject);
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(error);
    }];
//    
//    [[self AFNetManager] POST:[NSString stringWithFormat:@"%@%@",kRequestHeaderUrl,URLString] parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
//        //        for (FormData * data in formDataArray) {
//        //            [formData appendPartWithFileData:data.data
//        //                                        name:data.name
//        //                                    fileName:data.fileName
//        //                                    mimeType:data.mimeType];
//        //        }
//        // formData: 专门用于拼接需要上传的数据,在此位置生成一个要上传的数据体
//        // 这里的_photoArr是你存放图片的数组
//        for (int i = 0; i < formDataArray.count; i++) {
//            
//            UIImage *image = formDataArray[i];
//            NSData *imageData = UIImageJPEGRepresentation(image, 0.5);
//            // 在网络开发中，上传文件时，是文件不允许被覆盖，文件重名
//            // 要解决此问题，
//            // 可以在上传时使用当前的系统事件作为文件名
//            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//            // 设置时间格式
//            [formatter setDateFormat:@"yyyyMMddHHmmss"];
//            NSString *dateString = [formatter stringFromDate:[NSDate date]];
//            NSString *fileName = [NSString  stringWithFormat:@"%@%d.jpg", dateString,i];
//            /*
//             *该方法的参数
//             1. appendPartWithFileData：要上传的照片[二进制流]
//             2. name：对应网站上[upload.php中]处理文件的字段（比如upload）
//             3. fileName：要保存在服务器上的文件名
//             4. mimeType：上传的文件的类型
//             */
//            [formData appendPartWithFileData:imageData name:@"Upload" fileName:fileName mimeType:@"image/jpeg"]; //
//        }
//    } success:^(NSURLSessionDataTask *task, id responseObject) {
//        success(responseObject);
//        
//    } failure:^(NSURLSessionDataTask *task, NSError *error) {
//        failure(error);
//    }];
}

/**
 *  公用一个AFHTTPSessionManager
 *
 *  @return AFHTTPSessionManager
 */
+ (AFHTTPSessionManager *)AFNetManager
{
    static AFHTTPSessionManager *manager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [AFHTTPSessionManager manager];
        //设置请求的超时时间
        manager.requestSerializer.timeoutInterval = 60 * 2;
//        manager.securityPolicy = [self customSecurityPolicy];
        manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/html", @"text/json", @"text/plain", @"text/javascript", @"text/xml", @"image/*", nil];
    });
    return manager;
}

// SSL认证
+ (AFSecurityPolicy*)customSecurityPolicy

{
    // /先导入证书,证书导入项目中
    
    NSString *cerPath = [[NSBundle mainBundle] pathForResource:@"YourCertificate" ofType:@"cer"];//证书的路径
    
    NSData *certData = [NSData dataWithContentsOfFile:cerPath];
    
    // AFSSLPinningModeCertificate 使用证书验证模式
    
    AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
    
    // allowInvalidCertificates 是否允许无效证书（也就是自建的证书），默认为NO
    
    // 如果是需要验证自建证书，需要设置为YES
    
    securityPolicy.allowInvalidCertificates = YES;
    
    //validatesDomainName 是否需要验证域名，默认为YES；
    
    //假如证书的域名与你请求的域名不一致，需把该项设置为NO；如设成NO的话，即服务器使用其他可信任机构颁发的证书，也可以建立连接，这个非常危险，建议打开。
    
    //置为NO，主要用于这种情况：客户端请求的是子域名，而证书上的是另外一个域名。因为SSL证书上的域名是独立的，假如证书上注册的域名是www.google.com，那么mail.google.com是无法验证通过的；当然，有钱可以注册通配符的域名*.google.com，但这个还是比较贵的。
    
    //如置为NO，建议自己添加对应域名的校验逻辑。
    
    securityPolicy.validatesDomainName = NO;
    
    securityPolicy.pinnedCertificates = [NSSet setWithObjects:certData, nil];// @[certData];
    
    return securityPolicy;
    
}

#pragma mark - 网络加载相关

+ (void)starInfocatorVisible {
    
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
    
    [SVProgressHUD setDefaultAnimationType:SVProgressHUDAnimationTypeNative];
    
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
    
    [SVProgressHUD show ];
}

+ (void)stopIndicatorVisible {
    
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    
    [SVProgressHUD dismiss];

}

+ (void)showError:(NSString *)errorString {
    
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    
    [SVProgressHUD showErrorWithStatus:errorString];
    
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    
    [SVProgressHUD setDefaultAnimationType:SVProgressHUDAnimationTypeNative];
}
@end

#pragma mark request_sendModel


@interface DDNetworkManagerDate ()

@property(nonatomic,copy,readonly)NSString *url;
@property(nonatomic,strong,readonly)NSDictionary *parameters;

@end

@implementation DDNetworkManagerDate

+(instancetype)initWithUrl:(NSString *)url parameters:(NSDictionary *)parameters{
    return [[self alloc] initWithUrl:url parameters:parameters];
}

-(instancetype)initWithUrl:(NSString *)url parameters:(NSDictionary *)parameters{
    if (self = [super init]) {
        self.url = url;
        self.parameters = parameters;
    }
    return self;
}

-(void)setUrl:(NSString *)url{
    _url = url;
}

-(void)setParameters:(NSDictionary *)parameters{
    NSMutableDictionary *muparameters =(parameters)?parameters.mutableCopy:@{}.mutableCopy;
    //([DDUserManager sharedInstance].isLogin)?[muparameters setValue:[DDUserManager sharedInstance].userToken forKey:@"token"]:muparameters;
    NSArray *allKey = [muparameters allKeys];
    NSArray *values = [muparameters allValues];
    
    
    __block NSString *urlStr = @"";
    
    [allKey enumerateObjectsUsingBlock:^(NSString  *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        NSString *value = (idx < values.count)?value = values[idx]:@"";
        urlStr = [urlStr stringByAppendingFormat:@"&%@=%@",obj,value];
    }];
    
#ifdef DEBUG
    DLog(@"\n\n\n\n*************\n*****************\n%@%@%@?%@\n***************\n***************\n\n\n\n",kRequestHeaderUrl,@"",_url,urlStr);
#else
    
#endif
    _parameters = muparameters.copy;
    _url = [NSString stringWithFormat:@"%@%@",kRequestHeaderUrl,_url];
}

/**
 请求数据成功结果
 */
-(void)post_RequestFinshSuccess:(RequestSuccessBlock)success failure:(RequestFailureBlock )failure{
    
    [DDNetworkManager POST:self.url parameters:self.parameters success:success failure:failure];
}

/**
 get请求数据成功结果
 */
-(void)get_RequestFinshSuccess:(RequestSuccessBlock )success failure:(RequestFailureBlock )failure{
    [DDNetworkManager GET:self.url parameters:self.parameters success:success failure:failure];
}

/**
 post缓存 请求数据成功结果
 */
-(void)postCache_RequestFinshSuccess:(RequestSuccessBlock )success failure:(RequestFailureBlock )failure{
    [DDNetworkManager POSTCache:self.url parameters:self.parameters success:success failure:failure];
}

/**
 get 缓存 请求数据成功结果
 */
-(void)getCache_RequestFinshSuccess:(RequestSuccessBlock )success failure:(RequestFailureBlock )failure{
    [DDNetworkManager GETCache:self.url parameters:self.parameters success:success failure:failure];
}


///////////////////////////
///                     ///
///      网络接口         ///
///                     ///
///////////////////////////

#pragma mark-request_URL
#pragma mark -1. 登录注册
/**
 1.1发送验证码 （/api/public/sendsms）
 
 参数说明
 参数      说明
 mobile      手机号码
 type        短信类型
 
 短信类型取值
 register        注册
 forgotten       忘记密码
 modifypassword  修改密码
 login           短信登录
 
 */
+(instancetype)makeUrl_sendsms_with_user_phone:(NSString *)user_phone
                                     type:(NSString *)type {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (user_phone) {
        [param setObject:user_phone forKey:@"user_phone"];
    }
    if (type) {
        [param setObject:type forKey:@"type"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/base/sendSms" parameters:param];
}
/**
 1.1.1全部地址 (/api/base/allRegion)
 
无
 
 */
+(instancetype)makeUrl_sendsms_with_base_allRegion {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    
    return [DDNetworkManagerDate initWithUrl:@"/api/base/allRegion" parameters:param];
}

/**
 1.2 登录(/api/login/index）
 
 参数说明
 参数              说明
 user_phone      手机号码
 user_password   密码
 
 */
+(instancetype)makeUrl_login_with_user_phone:(NSString *)user_phone
                               user_password:(NSString *)user_password {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (user_phone) {
        [param setObject:user_phone forKey:@"user_phone"];
    }
    if (user_password) {
        [param setObject:user_password forKey:@"user_password"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/login/index" parameters:param];
}


/**
 1.3 验证码登录 （/api/login/verifyLogin)
 
 参数说明
 参数      说明
 user_phone          手机号码
 code            短信验证码
 
 */
+(instancetype)makeUrl_verifylogin_with_user_phone:(NSString *)user_phone
                                          code:(NSString *)code {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (user_phone) {
        [param setObject:user_phone forKey:@"user_phone"];
    }
    if (code) {
        [param setObject:code forKey:@"code"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/login/verifyLogin" parameters:param];
}

/**
 1.4 注册 （/api/login/register)
 
 参数说明
 参数              说明
 user_phone          手机号码
 user_password       密码
 code                短信验证码
 user_nickname       昵称
 user_truename       姓名
 user_sex            性别（0男1女）
 user_birthday       生日（1996-02-06）
 user_occupation     职业
 user_duties         职务
 user_business       业务范围
 user_hobby          爱好
 home_region_id      家乡地区id
 home_address        家乡详细地址
 region_name         当前城市名称
 
 */
+(instancetype)makeUrl_register_with_user_phone:(NSString *)user_phone
                                   user_password:(NSString *)user_password
                                       code:(NSString *)code
                              user_nickname:(NSString *)user_nickname
                              user_truename:(NSString *)user_truename
                                   user_sex:(NSString *)user_sex
                              user_birthday:(NSString *)user_birthday
                            user_occupation:(NSString *)user_occupation
                                user_duties:(NSString *)user_duties
                              user_business:(NSString *)user_business
                                 user_hobby:(NSString *)user_hobby
                             home_region_id:(NSString *)home_region_id
                               home_address:(NSString *)home_address
                                region_name:(NSString *)region_name{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (user_phone) {
        [param setObject:user_phone forKey:@"user_phone"];
    }
    if (user_password) {
        [param setObject:user_password forKey:@"user_password"];
    }
    if (code) {
        [param setObject:code forKey:@"code"];
    }
    if (user_nickname) {
        [param setObject:user_nickname forKey:@"user_nickname"];
    }
    if (user_truename) {
        [param setObject:user_truename forKey:@"user_truename"];
    }
    if (user_sex) {
        [param setObject:user_sex forKey:@"user_sex"];
    }
    if (user_birthday) {
        [param setObject:user_birthday forKey:@"user_birthday"];
    }
    if (user_occupation) {
        [param setObject:user_occupation forKey:@"user_occupation"];
    }
    if (user_duties) {
        [param setObject:user_duties forKey:@"user_duties"];
    }
    if (user_business) {
        [param setObject:user_business forKey:@"user_business"];
    }
    if (user_hobby) {
        [param setObject:user_hobby forKey:@"user_hobby"];
    }
    if (home_region_id) {
        [param setObject:home_region_id forKey:@"home_region_id"];
    }
    if (home_address) {
        [param setObject:home_address forKey:@"home_address"];
    }
    if (region_name) {
        [param setObject:region_name forKey:@"region_name"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/login/register" parameters:param];
}

/**
 1.5 忘记密码 （/api/login/forgetPassword)
 
 参数说明
 参数              说明
 user_phone      手机号码
 user_password   新密码
 code            短信验证码
 */
+(instancetype)makeUrl_forgetpwd_with_user_phone:(NSString *)user_phone
                                    user_password:(NSString *)user_password
                                        code:(NSString *)code {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (user_phone) {
        [param setObject:user_phone forKey:@"user_phone"];
    }
    if (user_password) {
        [param setObject:user_password forKey:@"user_password"];
    }
    if (code) {
        [param setObject:code forKey:@"code"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/login/forgetPassword" parameters:param];
}

#pragma mark -用户

/**
 2.1获取登录用户信息 （/api/user/userInfo)
 
 参数说明
 参数          说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_getuserinfo_with_token:(NSString *)token {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/userInfo" parameters:param];
}

/**
 2.2 修改信息 (/api/user/editUser)
 
 参数说明
 token               登录token信息
 user_nickname       昵称
 user_sign           个性签名
 user_sex            性别（0男1女）
 user_portrait       头像 七牛地址
 
 修改哪一项传哪一项参数
 
 */
+(instancetype)makeUrl_setUserInfo_with_token:(NSString *)token
                                user_nickname:(NSString *)user_nickname
                                     user_sex:(NSString *)user_sex
                                    user_sign:(NSString *)user_sign
                                user_portrait:(NSString *)user_portrait
                                       {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_nickname) {
        [param setObject:user_nickname forKey:@"user_nickname"];
    }
    if (user_sex) {
        [param setObject:user_sex forKey:@"user_sex"];
    }
    if (user_sign) {
        [param setObject:user_sign forKey:@"user_sign"];
    }
    if (user_portrait) {
        [param setObject:user_portrait forKey:@"user_portrait"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/user/editUser" parameters:param];
}


/**
 2.3 添加修改地址 (/api/user/editAddress)
 
 参数说明
 token           登录token
 address_id      id(0为添加否则为修改)
 user_name       姓名
 phone           手机号
 region_id       地区id
 address_info    详细地址
 is_default      默认地址0否1是
 
 */
+(instancetype)makeUrl_addAddress_with_token:(NSString *)token
                                  address_id:(NSString *)address_id
                                   user_name:(NSString *)user_name
                                       phone:(NSString *)phone
                                   region_id:(NSString *)region_id
                                address_info:(NSString *)address_info
                                  is_default:(NSString *)is_default {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (address_id) {
        [param setObject:address_id forKey:@"address_id"];
    }
    if (user_name) {
        [param setObject:user_name forKey:@"user_name"];
    }
    if (phone) {
        [param setObject:phone forKey:@"phone"];
    }
    if (region_id) {
        [param setObject:region_id forKey:@"region_id"];
    }
    if (address_info) {
        [param setObject:address_info forKey:@"address_info"];
    }
    if (is_default) {
        [param setObject:is_default forKey:@"is_default"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/user/editAddress" parameters:param];
}
/**
2.5 删除地址 (/api/user/delAddress)
 
 参数说明
 token   登录token信息
 address_id      地址id
 */
+(instancetype)makeUrl_delAddress_with_token:(NSString *)token
                                  address_id:(NSString *)address_id {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (address_id) {
        [param setObject:address_id forKey:@"address_id"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/delAddress" parameters:param];
}

/**
 2.6 获取用户地址列表（/api/user/addressList)
 
 参数说明
 token           登录user_token
 
 */
+(instancetype)makeUrl_getUserAddressList_with_token:(NSString *)token {
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/user/addressList" parameters:param];
}

/**
 2.7 充值 (/api/user/recharge)
 
 参数说明
 token       登录token信息
 type            类型0支付宝1微信
 money           金额
 
 */
+(instancetype)makeUrl_recharge_with_token:(NSString *)token
                                      type:(NSString *)type
                                     money:(NSString *)money{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (type) {
        [param setObject:type forKey:@"type"];
    }
    if (money) {
        [param setObject:money forKey:@"money"];
    }
    return [DDNetworkManagerDate initWithUrl:@"api/user/recharge" parameters:param];
}
/**
 2.8 账单列表 (/api/user/billList)
 参数说明
 token       登录token信息
 */
+(instancetype)makeUrl_billList_with_token:(NSString *)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/user/billList" parameters:param];
}
/**
 *2.10 修改密码 (/api/user/editPassword)
 参数说明
 token             登录token信息
 old_password        原密码
 new_password        新密码
 confirm_password    确认密码
 */
+(instancetype)makeUrl_editPassword_with_token:(NSString *)token
                                  old_password:(NSString *)old_password
                                  new_password:(NSString *)new_password
                              confirm_password:(NSString *)confirm_password{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (old_password) {
        [param setObject:old_password forKey:@"old_password"];
    }
    if (new_password) {
        [param setObject:new_password forKey:@"new_password"];
    }
    if (confirm_password) {
        [param setObject:confirm_password forKey:@"confirm_password"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/user/editPassword" parameters:param];
}

/**
 2.11 系统文章 (/api/base/sysArticle)
 参数说明
 token       登录token信息
 article_id      id（1使用协议）
 */
+(instancetype)makeUrl_sysArticle_with_token:(NSString *)token article_id:(NSString *)article_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (article_id) {
        [param setObject:article_id forKey:@"article_id"];
    }
    
    return [DDNetworkManagerDate initWithUrl:@"/api/base/sysArticle" parameters:param];
}
/**
 2.14 服务列表 (/api/user/service)
 参数说明
 token       登录token信息
 */
+(instancetype)makeUrl_user_serviceWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/service" parameters:param];
}

/**
2.16 黑名单 (/api/user/blackList)
 参数说明
 token       登录token信息
 */
+(instancetype)makeUrl_user_blackListWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/blackList" parameters:param];
}
/**
2.17 黑名单删除 (/api/user/delBlack)
 参数说明
 token       登录token信息
user_id         用户id
 */
+(instancetype)makeUrl_user_delBlackWithtoken:(NSString *)token
                                      user_id:(NSString *)user_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/delBlack" parameters:param];
}

/**
2.18 只给一窗 (/api/user/oneList)
 参数说明
 token       登录token信息
 */
+(instancetype)makeUrl_user_oneListWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/oneList" parameters:param];
}

/**
2.19 只给一窗删除 (/api/user/delOne)
 参数说明
 token       登录token信息
 user_id         用户id
 */
+(instancetype)makeUrl_user_delOneWithtoken:(NSString *)token
                                      user_id:(NSString *)user_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/delOne" parameters:param];
}
/**
2.20 我的收藏 (/api/user/collectionList)
 参数说明
 token       登录token信息
 */
+(instancetype)makeUrl_user_collectionListWithtoken:(NSString *)token
                                               page:(NSString *)page{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/collectionList" parameters:param];
}
/**
2.21 收藏删除 (/api/user/delCollection)
 参数说明
 token          登录token信息
collection_id   收藏id
 */
+(instancetype)makeUrl_user_delCollectionWithtoken:(NSString *)token
                                     collection_id:(NSString *)collection_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (collection_id) {
        [param setObject:collection_id forKey:@"collection_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/user/delCollection" parameters:param];
}
#pragma mark -通讯录
/**
4.1 扫码获取用户信息 (/api/base/qrcode)
 
 参数说明
 token             登录user_token信息
 user_id           用户id
 */
+(instancetype)makeUrl_batchGetUserQrcode_with_token:(NSString *)token
                                              user_id:(NSString *)user_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/base/qrcode" parameters:param];
}

/**
 4.3 添加好友 (/api/Friends/addFriends)
 
 参数说明
 token             登录user_token信息
 user_id           用户id
 */
+(instancetype)makeUrl_batchAddFriends_with_token:(NSString *)token
                                             user_id:(NSString *)user_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Friends/addFriends" parameters:param];
}
/**
4.4 手机联系人 (/api/Friends/contacts)
 
 参数说明
 token             登录user_token信息
contacts           传入手机联系人 格式{"13805477546":"张三","13805477547":"李四"}
 */
+(instancetype)makeUrl_batchAddContacts_with_token:(NSString *)token
                                          contacts:(NSString *)contacts{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (contacts) {
        [param setObject:contacts forKey:@"contacts"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Friends/contacts" parameters:param];
}
/**
4.5 通讯录联系人 (/api/Friends/index)
 
 参数说明
 token             登录user_token信息
 contacts           传入手机联系人 格式{"13805477546":"张三","13805477547":"李四"}
 */
+(instancetype)makeUrl_batchFriends_index_with_token:(NSString *)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Friends/index" parameters:param];
}
/**
4.6 新朋友 (/api/Friends/newFriends)
 
 参数说明
 token             登录user_token信息

 */
+(instancetype)makeUrl_newFriends_with_token:(NSString *)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Friends/newFriends" parameters:param];
}
/**
4.12 好友动态 (/api/Friends/friendsPost)
 
 参数说明
 token             登录user_token信息
 user_id         用户id
 page            页数默认1
 
 */
+(instancetype)makeUrl_friendsPost_with_token:(NSString *)token
                                      user_id:(NSString *)user_id
                                         page:(NSString *)page{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Friends/friendsPost" parameters:param];
}
/**
 4.25 好友资料 (/api/Friends/information)
 
 参数说明
 参数              说明
 user_id         好友id
 */
+(instancetype)makeUrl_Friends_informationWithToken:(NSString *)token
                                             user_id:(NSString *)user_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Friends/information" parameters:param];
}



#pragma mark -发现
/**
 5.1文件上传（/api/file/upload)
 
 参数说明
 上传使用post方式提交 提交文件需要键值
 参数          说明
 token         登录token信息
 文件键值      上传文件键值
 */


/**
 获取七牛上传信息 （/api/base/qiniu)
 
 参数说明
 token           登录token信息
 */
+(instancetype)makeUrl_getQiniuUploadInfo_token:(NSString *)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/base/qiniu" parameters:param];
}

/**
5.2 发布博见 (/api/post/release)
 
 参数说明
 token           登录token信息
 post_type       类型0快照1爱拍2佳文
 post_title      标题 快照爱拍的文字部分，佳文的标题
 post_content    内容 快照爱拍的图片视频，佳文的内容，快照多个图片,号隔开
 */
+(instancetype)makeUrl_post_releaseWithtoken:(NSString *)token
                                   post_type:(NSString *)post_type
                                  post_title:(NSString *)post_title
                                post_content:(NSString *)post_content{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_type) {
        [param setObject:post_type forKey:@"post_type"];
    }
    if (post_title) {
        [param setObject:post_title forKey:@"post_title"];
    }
    if (post_content) {
        [param setObject:post_content forKey:@"post_content"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/release" parameters:param];
}
/**
5.3 博见内容 (/api/post/postInfo)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 */
+(instancetype)makeUrl_post_postInfoWithtoken:(NSString *)token
                                      post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/postInfo" parameters:param];
}

/**
5.4 编辑博见 (/api/post/editPost)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 post_title      标题 佳文需要
 post_content    博见内容 数组形式 图片视频为七牛地址

 */
+(instancetype)makeUrl_post_editPostWithtoken:(NSString *)token
                                      post_id:(NSString *)post_id
                                   post_title:(NSString *)post_title
                                 post_content:(NSString *)post_content{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (post_title) {
        [param setObject:post_title forKey:@"post_title"];
    }
    if (post_content) {
        [param setObject:post_content forKey:@"post_content"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/editPost" parameters:param];
}
/**
5.5 删除博见 (/api/post/delPost)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 */
+(instancetype)makeUrl_post_delPostWithtoken:(NSString *)token
                                      post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/delPost" parameters:param];
}
/**
 5.5  博见列表 (/api/post/postList)
 
 参数说明
 token           登录token信息
 post_type       类型0快照1爱拍2佳文
 post_order      排序0时间1人气2点赞3礼物4热评5推荐
 user_sex        性别0男1女2不限
 user_active     活跃0一小时1六小时2今日3昨日4一周
 region_id       区域0本地
 user_age        年龄 11,33两个逗号隔开
 user_hobby      爱好
 user_occupation 职业
 user_type       0家门1老乡
 user_rank       只看会员0否1是
 is_search       是否搜索0否1是
 post_cate       0行人1粉丝2关注3朋友4游客
 page            页数默认1
 */
+(instancetype)makeUrl_postBJ_postListWithtoken:(NSString *)token
                                    post_type:(NSString *)post_type
                                   post_order:(NSString *)post_order
                                     user_sex:(NSString *)user_sex
                                  user_active:(NSString *)user_active
                                    region_id:(NSString *)region_id
                                     user_age:(NSString *)user_age
                                   user_hobby:(NSString *)user_hobby
                              user_occupation:(NSString *)user_occupation
                                    user_type:(NSString *)user_type
                                    user_rank:(NSString *)user_rank
                                    is_search:(NSString *)is_search
                                    post_cate:(NSString *)post_cate
                                         page:(NSString *)page{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_type) {
        [param setObject:post_type forKey:@"post_type"];
    }
    if (post_order) {
        [param setObject:post_order forKey:@"post_order"];
    }
    if (user_sex) {
        [param setObject:user_sex forKey:@"user_sex"];
    }
    if (user_active) {
        [param setObject:user_active forKey:@"user_active"];
    }
    if (region_id) {
        [param setObject:region_id forKey:@"region_id"];
    }
    if (user_age) {
        [param setObject:user_age forKey:@"user_age"];
    }
    if (user_hobby) {
        [param setObject:user_hobby forKey:@"user_hobby"];
    }
    if (user_occupation) {
        [param setObject:user_occupation forKey:@"user_occupation"];
    }
    if (user_type) {
        [param setObject:user_type forKey:@"user_type"];
    }
    if (user_rank) {
        [param setObject:user_rank forKey:@"user_rank"];
    }
    if (is_search) {
        [param setObject:is_search forKey:@"is_search"];
    }
    if (post_cate) {
        [param setObject:post_cate forKey:@"post_cate"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/postList" parameters:param];
}
/**
5.6 我的博见 (/api/post/minePost)
 
 参数说明
 token           登录token信息
 page            页数默认1
 */
+(instancetype)makeUrl_postBJ_minePostListWithtoken:(NSString *)token
                                               page:(NSString *)page{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/minePost" parameters:param];
}
/**
5.7 博见点赞 (/api/post/postPraise)
 
 参数说明
 token           登录token信息
post_id         博见的id
 */
+(instancetype)makeUrl_postBJ_postPraiseWithtoken:(NSString *)token
                                          post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/postPraise" parameters:param];
}
/**
5.8 博见关注 (/api/post/addFollow)
 
 参数说明
 token           登录token信息
 user_id         用户id
 follow_type     类型0关注1悄悄关注
 */
+(instancetype)makeUrl_post_addFollowWithtoken:(NSString *)token
                                       user_id:(NSString *)user_id
                                   follow_type:(NSString *)follow_type{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (follow_type) {
        [param setObject:follow_type forKey:@"follow_type"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/addFollow" parameters:param];
}

/**
5.9 博见推荐 (/api/post/postShare)
 参数说明
 token           登录token信息
 post_id         博见的id
 */
+(instancetype)makeUrl_post_postShareWithtoken:(NSString *)token
                                       post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/postShare" parameters:param];
}

/**
5.10 博见收藏 (/api/post/postCollection)
 参数说明
 token           登录token信息
 post_id         博见的id
 */
+(instancetype)makeUrl_post_postCollectionWithtoken:(NSString *)token
                                            post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/postCollection" parameters:param];
}
/**
5.11 拉黑 (/api/post/addBlack)
 参数说明
 token           登录token信息
 user_id         用户id
 */
+(instancetype)makeUrl_post_addBlackWithtoken:(NSString *)token
                                       user_id:(NSString *)user_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/addBlack" parameters:param];
}
/**
5.12 只给一窗 (/api/post/addOne)
 参数说明
 token           登录token信息
 user_id         用户id
 */
+(instancetype)makeUrl_post_addOneWithtoken:(NSString *)token
                                      user_id:(NSString *)user_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/addOne" parameters:param];
}
/**
5.13 举报 (/api/post/addReport)
 参数说明
 token           登录token信息
 post_id         博见的id
 report_type     类型0广告1欺诈2骚扰3违法
 */
+(instancetype)makeUrl_post_addReportWithtoken:(NSString *)token
                                       post_id:(NSString *)post_id
                                   report_type:(NSString *)report_type{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (report_type) {
        [param setObject:report_type forKey:@"report_type"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/addReport" parameters:param];
}
/**
5.14 点赞列表 (/api/post/praiseList)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 */
+(instancetype)makeUrl_postBJ_praiseListWithtoken:(NSString *)token
                                         post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/praiseList" parameters:param];
}

/**
5.15 评论 (/api/post/postComment)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 parent_id       回复评论id
 comment_type    类型0文字1语音 七牛地址
 comment_content 评论内容
 */
+(instancetype)makeUrl_postBJ_postCommentWithtoken:(NSString *)token
                                           post_id:(NSString *)post_id
                                         parent_id:(NSString *)parent_id
                                      comment_type:(NSString *)comment_type
                                   comment_content:(NSString *)comment_content{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (parent_id) {
        [param setObject:parent_id forKey:@"parent_id"];
    }
    if (comment_type) {
        [param setObject:comment_type forKey:@"comment_type"];
    }
    if (comment_content) {
        [param setObject:comment_content forKey:@"comment_content"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/postComment" parameters:param];
}

/**
5.16 评论列表 (/api/post/commentList)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 page            页数默认1
 */
+(instancetype)makeUrl_postBJ_commentListWithtoken:(NSString *)token
                                           post_id:(NSString *)post_id
                                              page:(NSString *)page{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/commentList" parameters:param];
}

/**
5.17 礼物列表 (/api/post/giftList)
 
 参数说明
 token           登录token信息
 post_id         博见的id
 page            页数默认1
 */
+(instancetype)makeUrl_postBJ_giftListWithtoken:(NSString *)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
   
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/giftList" parameters:param];
}
/**
 5.18 赠送礼物 (/api/post/toGift)
 
 参数说明
 参数              说明
 user_id         用户id
 gift_id         礼物id
 post_id         博见id
 */
+(instancetype)makeUrl_postBJ_toGiftWithtoken:(NSString *)token
                                      user_id:(NSString *)user_id
                                      gift_id:(NSString *)gift_id
                                      post_id:(NSString *)post_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (gift_id) {
        [param setObject:gift_id forKey:@"gift_id"];
    }
    if (post_id) {
        [param setObject:post_id forKey:@"post_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/post/toGift" parameters:param];
}

#pragma mark -商家动态
/**
6.1 默认标签 (/api/Dynamic/defaultTag)
 
 参数说明
 token           登录token信息
parent_id       父级id 默认1 1.门面2.公司3.电商4.小摊5.自产

 */
+(instancetype)makeUrl_Dynamic_defaultTagWithtoken:(NSString *)token
                                         parent_id:(NSString *)parent_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (parent_id) {
        [param setObject:parent_id forKey:@"parent_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Dynamic/defaultTag" parameters:param];
}
/**
6.2 更多标签 (/api/Dynamic/moreTag)
 
 参数说明
 token           登录token信息
 parent_id       父级id 默认1 1.门面2.公司3.电商4.小摊5.自产
 
 */
+(instancetype)makeUrl_Dynamic_moreTagWithtoken:(NSString *)token
                                         parent_id:(NSString *)parent_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (parent_id) {
        [param setObject:parent_id forKey:@"parent_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Dynamic/moreTag" parameters:param];
}
/**
6.3 动态列表 (/api/Dynamic/dynamicList)
 
 参数说明
 token           登录token信息
 shop_type       门店类型
 tag_id          分类id
 type            0区域1外来
 page            页数默认1
 
 */
+(instancetype)makeUrl_Dynamic_dynamicListWithtoken:(NSString *)token
                                          shop_type:(NSString *)shop_type
                                             tag_id:(NSString *)tag_id
                                               type:(NSString *)type
                                               page:(NSString *)page{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (shop_type) {
        [param setObject:shop_type forKey:@"shop_type"];
    }
    if (tag_id) {
        [param setObject:tag_id forKey:@"tag_id"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (type) {
        [param setObject:type forKey:@"type"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Dynamic/dynamicList" parameters:param];
}
/**
 6.13 关注 (/api/Dynamic/addFollow)
 
 参数说明
 参数              说明
 user_id         对方用户id
 */
+(instancetype)makeUrl_Dynamic_addFollowWithToken:(NSString *)token
                                            user_id:(NSString *)user_id{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Dynamic/addFollow" parameters:param];
}

#pragma mark -身边天下

/**
7.4 默认标签 (/api/news/defaultTag)
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_news_defaultTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/news/defaultTag" parameters:param];
}
/**
7.5 全部标签 (/api/news/allTag)
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_news_allTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/news/allTag" parameters:param];
}
#pragma mark -快急商务

/**
8.1 默认标签 (/api/Business/defaultTag)
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_Business_defaultTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/defaultTag" parameters:param];
}
/**
8.2 全部标签 (/api/Business/allTag)
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_Business_allTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/allTag" parameters:param];
}
/**
 8.5 商务列表 (/api/Business/businessList)
 
 参数说明
 参数              说明
 tag_id          分类id
 page            页数默认1
 
 */
+(instancetype)makeUrl_Business_businessListWithtoken:(NSString *)token
                                         tag_id:(NSString *)tag_id
                                           page:(NSString *)page{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (tag_id) {
        [param setObject:tag_id forKey:@"tag_id"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/businessList" parameters:param];
}
/**
 8.6 我的商务 (/api/Business/myBusiness)
 
 参数说明
 参数              说明
 page            页数默认1
 
 */
+(instancetype)makeUrl_Business_myBusinessWithtoken:(NSString *)token
                                                 page:(NSString *)page{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/myBusiness" parameters:param];
}

/**
 8.10 发布商务 (/api/Business/addBusiness)
 
 参数说明
 参数              说明
 tag_id1         一级分类
 tag_id2         二级分类
 business_title  标题
 business_content内容
 day             购买天数
 
 */
+(instancetype)makeUrl_Business_addBusinessWithtoken:(NSString *)token
                                             tag_id1:(NSString *)tag_id1
                                             tag_id2:(NSString *)tag_id2
                                      business_title:(NSString *)business_title
                                    business_content:(NSString *)business_content
                                                 day:(NSString *)day{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (tag_id1) {
        [param setObject:tag_id1 forKey:@"tag_id1"];
    }
    if (tag_id2) {
        [param setObject:tag_id2 forKey:@"tag_id2"];
    }
    if (business_title) {
        [param setObject:business_title forKey:@"business_title"];
    }
    if (business_content) {
        [param setObject:business_content forKey:@"business_content"];
    }
    if (day) {
        [param setObject:day forKey:@"day"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/addBusiness" parameters:param];
}
/**
 8.14 拉黑 (/api/Business/addBlack)
 
 参数说明
 参数              说明
 user_id         用户id
 
 */
+(instancetype)makeUrl_Business_addBlackWithtoken:(NSString *)token
                                        user_id:(NSString *)user_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (user_id) {
        [param setObject:user_id forKey:@"user_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/addBlack" parameters:param];
}
/**
 8.15 举报 (/api/Business/addReport)
 
 参数说明
 参数              说明
 business_id     id
 report_type     类型0广告1欺诈2骚扰3违法
 
 */
+(instancetype)makeUrl_Business_addReportWithtoken:(NSString *)token
                                       business_id:(NSString *)business_id
                                       report_type:(NSString *)report_type{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (business_id) {
        [param setObject:business_id forKey:@"business_id"];
    }
    if (report_type) {
        [param setObject:report_type forKey:@"report_type"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Business/addReport" parameters:param];
}

#pragma mark -拼车运货
/**
9.1 默认标签 (/api/Freight/defaultTag)
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_Freight_defaultTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Freight/defaultTag" parameters:param];
}
/**
9.2 全部标签 (/api/Freight/allTag)
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_Freight_allTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Freight/allTag" parameters:param];
}
/**
 9.5 入驻申请 (/api/Freight/enter)
 
 参数说明
 参数              说明
 img1            图片1
 img2            图片2
 
 */
+(instancetype)makeUrl_Freight_enterWithtoken:(NSString *)token
                                         img1:(NSString *)img1
                                         img2:(NSString *)img2{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (img1) {
        [param setObject:img1 forKey:@"img1"];
    }
    if (img2) {
        [param setObject:img2 forKey:@"img2"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Freight/enter" parameters:param];
}
/**
9.5 入驻申请状态 (/api/Freight/freightShopStatus)
 
 参数说明
 参数              说明
user_token        user_token
 
 */
+(instancetype)makeUrl_Freight_freightShopStatusWithtoken:(NSString *)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/Freight/freightShopStatus" parameters:param];
}

#pragma mark - 商城
/**
10.1.2 门店类型 (/api/mall/shopType）
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_mall_shopTypeWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/shopType" parameters:param];
}

/**
10.1.3 商铺标签 (/api/mall/shopTag）
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_mall_shopTagWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/shopTag" parameters:param];
}
/**
10.1.4 广告列表 (/api/mall/adList）
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_mall_adListWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/adList" parameters:param];
}
/**
10.1.5 分类列表 (/api/mall/classifyList)）
 
 参数说明
 token           登录token信息
 
 */
+(instancetype)makeUrl_mall_classifyListWithtoken:(NSString *)token{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/classifyList" parameters:param];
}
/**
 10.1.6 首页列表 (/api/mall/indexList)
 
 参数说明
 参数              说明
 token           登录token信息
 page            页数默认1
 side            位置 0本地1外地
 type            类型 0商品1商铺2服务
 price           价格 最低,最高 22,55
 shop_type       门店类型id
 tag_id          标签id
 classify_id     分类id
 sort            排序0距离1人气2好评3销量
 
 */
+(instancetype)makeUrl_mall_indexListWithtoken:(NSString *)token
                                          page:(NSString *)page
                                          side:(NSString *)side
                                          type:(NSString *)type
                                         price:(NSString *)price
                                     shop_type:(NSString *)shop_type
                                        tag_id:(NSString *)tag_id
                                   classify_id:(NSString *)classify_id
                                          sort:(NSString *)sort{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (side) {
        [param setObject:side forKey:@"side"];
    }
    if (type) {
        [param setObject:type forKey:@"type"];
    }
    if (price) {
        [param setObject:price forKey:@"price"];
    }
    if (shop_type) {
        [param setObject:shop_type forKey:@"shop_type"];
    }
    if (tag_id) {
        [param setObject:tag_id forKey:@"tag_id"];
    }
    if (classify_id) {
        [param setObject:classify_id forKey:@"classify_id"];
    }
    if (sort) {
        [param setObject:sort forKey:@"sort"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/indexList" parameters:param];
}
#pragma mark -资讯
/**
10.3.1 资讯列表 (/api/mall/articleList）
 
 参数说明
 token           登录token信息
 page            页数默认1
 
 */
+(instancetype)makeUrl_mall_articleListWithtoken:(NSString *)token
                                            page:(NSString *)page{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (page) {
        [param setObject:page forKey:@"page"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/articleList" parameters:param];
}
/**
 10.3.2 资讯详情 (/api/mall/articleInfo）
 
 参数说明
 参数              说明
token           登录token信息
 article_id      文章id
 
 */
+(instancetype)makeUrl_mall_articleInfoWithtoken:(NSString *)token
                                      article_id:(NSString *)article_id{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    if (article_id) {
        [param setObject:article_id forKey:@"article_id"];
    }
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/mall/articleInfo" parameters:param];
}

#pragma mark -商铺后台
/**
 11.35 菜单列表 (/api/shop/menuList)
 
 */
+(instancetype)makeUrl_shop_menuListWithToken:(NSString*)token{
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    if (token) {
        [param setObject:token forKey:@"user_token"];
    }
    
    if (k_user_lat) {
        [param setObject:k_user_lat forKey:@"lat"];
    }
    if (k_user_lng) {
        [param setObject:k_user_lng forKey:@"lng"];
    }
    return [DDNetworkManagerDate initWithUrl:@"/api/shop/menuList" parameters:param];
}


             
             
@end

@implementation FormData


@end
